# -*- coding: utf-8 -*-
from openerp.osv import osv
from openerp.osv import fields


class product_public_category(osv.osv):
    _inherit = 'product.public.category'

    _order = 'parent_id,sequence,name'
    def get_root_categorys(self, cr, uid, context=None):
        return self.search_read(cr, uid, [('parent_id', '=', False)], ['name'], order='sequence asc', context=context)

    _columns = {
        'template_ids': fields.many2many('product.template', string=u'关联产品'),
    }
